package com.homework.homework3;

import java.util.ArrayList;

public class Test03 {
    public static void main(String[] args) {
        ArrayList<String> objects = new ArrayList<>();
        objects.add("a");
        objects.add("b");
        objects.add("c");
        objects.add("c");
        objects.add("a");
        objects.add("b");
        objects.add("b");
        objects.add("b");
        objects.add("a");
        int a = frequency(objects, "a");
        System.out.println(a);


    }
    public static int frequency(ArrayList<String> arr, String key){
        int count=0;
        for (String s : arr) {
            if(s.equals("a")){
                count++;
            }
        }
        return count;
    }
}
